/*
 * @Author: ischen.x ischen.x@foxmail.com
 * @Date: 2024-07-11 13:29:34
 * @LastEditors: ischen.x ischen.x@foxmail.com
 * @LastEditTime: 2024-07-19 16:01:13
 * 
 * Copyright (c) 2024 by ischen.x, All Rights Reserved. 
 */
#ifndef __CMDLINE_H
#define __CMDLINE_H

#include "linenoise.h"

#define RED        "\033[31m"
#define GREEN       "\033[32m"
#define NONE_COLOR  "\033[0m"

#define CMD_ARG_COUNT_MAX 10

typedef int (*cmdline_cb)(int argc, char **argv);

typedef struct _cmd{
    char *cmd;
    cmdline_cb cb;
    struct _cmd *next;
}Cmd;

int cmdine_start(void);
int cmdline_new(const char *cmd, cmdline_cb cb);
int cmdline_del(const char *cmd);
int cmdline_get_ctrl_c(void);

#endif /* __CMDLINE_H */
